\hypertarget{classsc2_1_1_client_events}{}\section{sc2\+:\+:Client\+Events Class Reference}
\label{classsc2_1_1_client_events}\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}


A set of common events a user can override in their derived bot or replay observer class.  




{\ttfamily \#include $<$sc2\+\_\+client.\+h$>$}

Inheritance diagram for sc2\+:\+:Client\+Events\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classsc2_1_1_client_events}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classsc2_1_1_client_events_ab980f6942030d3a0cd42e00782742237}\label{classsc2_1_1_client_events_ab980f6942030d3a0cd42e00782742237}} 
virtual void \hyperlink{classsc2_1_1_client_events_ab980f6942030d3a0cd42e00782742237}{On\+Game\+Full\+Start} ()
\begin{DoxyCompactList}\small\item\em Called when a game is started after a load. Fast restarting will not call this. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_client_events_a6e2542b183f6ac980440cc93476163a3}\label{classsc2_1_1_client_events_a6e2542b183f6ac980440cc93476163a3}} 
virtual void \hyperlink{classsc2_1_1_client_events_a6e2542b183f6ac980440cc93476163a3}{On\+Game\+Start} ()
\begin{DoxyCompactList}\small\item\em Called when a game is started or restarted. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_client_events_a2c5023d18ffc88bed76c844e643ef60d}\label{classsc2_1_1_client_events_a2c5023d18ffc88bed76c844e643ef60d}} 
virtual void \hyperlink{classsc2_1_1_client_events_a2c5023d18ffc88bed76c844e643ef60d}{On\+Game\+End} ()
\begin{DoxyCompactList}\small\item\em Called when a game has ended. \end{DoxyCompactList}\item 
virtual void \hyperlink{classsc2_1_1_client_events_a6f5839e220d2a5a19b30065e0b8290c4}{On\+Step} ()
\item 
virtual void \hyperlink{classsc2_1_1_client_events_a17297ffdf866ab1f4c3c31de64a1bc59}{On\+Unit\+Destroyed} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$)
\item 
virtual void \hyperlink{classsc2_1_1_client_events_ac7fc1dae3607d7e4fea5680bcea903a0}{On\+Unit\+Created} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$)
\item 
virtual void \hyperlink{classsc2_1_1_client_events_adce0fc98fa9c3cc092a5a8b3f2feef45}{On\+Unit\+Idle} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$)
\item 
virtual void \hyperlink{classsc2_1_1_client_events_a4cdc022420833b34fbcd1c9713096754}{On\+Upgrade\+Completed} (\hyperlink{classsc2_1_1_s_c2_type}{Upgrade\+ID})
\item 
virtual void \hyperlink{classsc2_1_1_client_events_ad920d34fe6c49487373800dd1ec45757}{On\+Building\+Construction\+Complete} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$)
\item 
\mbox{\Hypertarget{classsc2_1_1_client_events_afde152c65ab94bdb57e345a8fd1532aa}\label{classsc2_1_1_client_events_afde152c65ab94bdb57e345a8fd1532aa}} 
virtual void \hyperlink{classsc2_1_1_client_events_afde152c65ab94bdb57e345a8fd1532aa}{On\+Nydus\+Detected} ()
\begin{DoxyCompactList}\small\item\em Called when a nydus is placed. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_client_events_ab9923f256e3bf6e518ccb8ec26f8ae88}\label{classsc2_1_1_client_events_ab9923f256e3bf6e518ccb8ec26f8ae88}} 
virtual void \hyperlink{classsc2_1_1_client_events_ab9923f256e3bf6e518ccb8ec26f8ae88}{On\+Nuclear\+Launch\+Detected} ()
\begin{DoxyCompactList}\small\item\em Called when a nuclear launch is detected. \end{DoxyCompactList}\item 
virtual void \hyperlink{classsc2_1_1_client_events_a3d73b5a3462f757397ea5ac2f4aca8dc}{On\+Unit\+Enter\+Vision} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$)
\item 
\mbox{\Hypertarget{classsc2_1_1_client_events_a35424cb2a0baa509f997149521ab2c52}\label{classsc2_1_1_client_events_a35424cb2a0baa509f997149521ab2c52}} 
virtual void \hyperlink{classsc2_1_1_client_events_a35424cb2a0baa509f997149521ab2c52}{On\+Error} (const std\+::vector$<$ \hyperlink{sc2__client_8h_ac7d3e3694a208204e099f04c1e5eded0}{Client\+Error} $>$ \&, const std\+::vector$<$ std\+::string $>$ \&=\{\})
\begin{DoxyCompactList}\small\item\em Called for various errors the library can encounter. See Client\+Error enum for possible errors. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A set of common events a user can override in their derived bot or replay observer class. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classsc2_1_1_client_events_ad920d34fe6c49487373800dd1ec45757}\label{classsc2_1_1_client_events_ad920d34fe6c49487373800dd1ec45757}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Building\+Construction\+Complete@{On\+Building\+Construction\+Complete}}
\index{On\+Building\+Construction\+Complete@{On\+Building\+Construction\+Complete}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Building\+Construction\+Complete()}{OnBuildingConstructionComplete()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Building\+Construction\+Complete (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

Called when the unit in the previous step had a build progress less than 1.\+0 but is greater than or equal to 1.\+0 in the current step. 
\begin{DoxyParams}{Parameters}
{\em unit} & The constructed unit. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_client_events_a6f5839e220d2a5a19b30065e0b8290c4}\label{classsc2_1_1_client_events_a6f5839e220d2a5a19b30065e0b8290c4}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Step@{On\+Step}}
\index{On\+Step@{On\+Step}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Step()}{OnStep()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Step (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

In non realtime games this function gets called after each step as indicated by step size. In realtime this function gets called as often as possible after request/responses are received from the game gathering observation state. \mbox{\Hypertarget{classsc2_1_1_client_events_ac7fc1dae3607d7e4fea5680bcea903a0}\label{classsc2_1_1_client_events_ac7fc1dae3607d7e4fea5680bcea903a0}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Unit\+Created@{On\+Unit\+Created}}
\index{On\+Unit\+Created@{On\+Unit\+Created}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Unit\+Created()}{OnUnitCreated()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Unit\+Created (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

Called when a \hyperlink{classsc2_1_1_unit}{Unit} has been created by the player. 
\begin{DoxyParams}{Parameters}
{\em unit} & The created unit. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_client_events_a17297ffdf866ab1f4c3c31de64a1bc59}\label{classsc2_1_1_client_events_a17297ffdf866ab1f4c3c31de64a1bc59}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Unit\+Destroyed@{On\+Unit\+Destroyed}}
\index{On\+Unit\+Destroyed@{On\+Unit\+Destroyed}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Unit\+Destroyed()}{OnUnitDestroyed()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Unit\+Destroyed (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

Called whenever one of the player\textquotesingle{}s units has been destroyed. 
\begin{DoxyParams}{Parameters}
{\em unit} & The destroyed unit. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_client_events_a3d73b5a3462f757397ea5ac2f4aca8dc}\label{classsc2_1_1_client_events_a3d73b5a3462f757397ea5ac2f4aca8dc}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Unit\+Enter\+Vision@{On\+Unit\+Enter\+Vision}}
\index{On\+Unit\+Enter\+Vision@{On\+Unit\+Enter\+Vision}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Unit\+Enter\+Vision()}{OnUnitEnterVision()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Unit\+Enter\+Vision (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

Called when an enemy unit enters vision from out of fog of war. 
\begin{DoxyParams}{Parameters}
{\em unit} & The unit entering vision. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_client_events_adce0fc98fa9c3cc092a5a8b3f2feef45}\label{classsc2_1_1_client_events_adce0fc98fa9c3cc092a5a8b3f2feef45}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Unit\+Idle@{On\+Unit\+Idle}}
\index{On\+Unit\+Idle@{On\+Unit\+Idle}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Unit\+Idle()}{OnUnitIdle()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Unit\+Idle (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

Called when a unit becomes idle, this will only occur as an event so will only be called when the unit becomes idle and not a second time. Being idle is defined by having orders in the previous step and not currently having orders or if it did not exist in the previous step and now does, a unit being created, for instance, will call both On\+Unit\+Created and On\+Unit\+Idle if it does not have a rally set. 
\begin{DoxyParams}{Parameters}
{\em unit} & The idle unit. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_client_events_a4cdc022420833b34fbcd1c9713096754}\label{classsc2_1_1_client_events_a4cdc022420833b34fbcd1c9713096754}} 
\index{sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}!On\+Upgrade\+Completed@{On\+Upgrade\+Completed}}
\index{On\+Upgrade\+Completed@{On\+Upgrade\+Completed}!sc2\+::\+Client\+Events@{sc2\+::\+Client\+Events}}
\subsubsection{\texorpdfstring{On\+Upgrade\+Completed()}{OnUpgradeCompleted()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Client\+Events\+::\+On\+Upgrade\+Completed (\begin{DoxyParamCaption}\item[{\hyperlink{classsc2_1_1_s_c2_type}{Upgrade\+ID}}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}

Called when an upgrade is finished, warp gate, ground weapons, baneling speed, etc. 
\begin{DoxyParams}{Parameters}
{\em upgrade} & The completed upgrade. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/sc2api/\hyperlink{sc2__client_8h}{sc2\+\_\+client.\+h}\end{DoxyCompactItemize}
